<?php
class Pageley_Commerce_Domain_OrderItem extends Pageley_Domain_BasicEntity {
	public function __construct($article = null, $quantity = null) {
		parent::__construct(self::type());
		if($article !== null) {
		    $this->set("article", $article);
            $this->set("price", $article->get("price"));
		}
		if($quantity !== null) {
		    $this->set("quantity", $quantity);
	    }
	}

	public static function type() {
		$factory = Pageley_Config::getInstance();
		return $factory->valueOf("type.commerce.OrderItem");
	}
}